import 'package:cjybase/widget/dialog/content_btn1_dialog.dart';
import 'package:cjybase/widget/dialog/content_btn2_dialog.dart';
import 'package:flutter/material.dart';

class DialogFactory {
  /// 一个按钮的中间提示dialog
  static contentBtn1Dialog(
      BuildContext context, String title, String content, ButtonClick btnClick,
      {String btnContent = "我知道了"}) {
    showDialog(
        barrierDismissible: false,
        context: context,
        builder: (BuildContext context) {
          return ContentBtn1Dialog(title, content, btnClick, btnContent);
        });
  }

  /// 两个按钮的中间提示dialog
  static contentBtn2Dialog(
      BuildContext context,
      String title,
      String content,
      LeftButtonClick leftClick,
      RightButtonClick rightClick,
      {String leftContent = "取消",
      String rightContent = "确定"}) {
    showDialog(
        barrierDismissible: false,
        context: context,
        builder: (BuildContext context) {
          return ContentBtn2Dialog(
              title, content, leftClick, rightClick, leftContent, rightContent);
        });
  }
}
